<?php

class ctrl_firadio_php_admin_sys_menuclass extends ctrl_firadio_php_admin_common {

    public function action_list() {
        // 默认的排序
        $this->table->defaorder = 'menuclass.id ASC';
        // 要读取的字段
        $this->table->field = 'menuclass.id,menuclass.name,menuclass.title,menuclass.parentdir,menuclass.enable,menuclass.visible,projmodule.name modulename,project.name projectname,company.name companyname';
        // 获取查询列表
        $this->tablelist = $this->table->getList();
        return($this->getdata());
    }

    public function action_add() {
        return($this->getdata());
    }

    public function action_edit() {
        // 提交对菜单分类的修改操作
        $this->ret = $this->menu->setClassInfo($_GET['id'], $_POST);
        return($this->getdata());
    }

    public function action_del() {
        return($this->getdata());
    }

    public function action_info() {
        // 读取分类信息
        $this->tables['menuclassinfo'] = $this->menu->getClassInfo($_GET['id']);
        // 读该分类下的子项
        $this->tables['menuitem'] = $this->menu->getItems('byclassid', $_GET['id']);
        return($this->getdata());
    }

}